package com.blockchain.nodes.manager.mapper;

import com.blockchain.nodes.manager.domain.AccountAddress;
import com.blockchain.nodes.manager.vo.UserBanlanceVO;

import java.util.List;

import org.apache.ibatis.annotations.Param;	

/**
 * 账户地址 数据层
 * 
 * @author Gene Max
 * @date 2019-03-08
 */
public interface AccountAddressMapper 
{
	/**
     * 查询账户地址信息
     * 
     * @param id 账户地址ID
     * @return 账户地址信息
     */
	public AccountAddress selectAccountAddressById(Long id);
	
	/**
     * 查询账户地址列表
     * 
     * @param accountAddress 账户地址信息
     * @return 账户地址集合
     */
	public List<AccountAddress> selectAccountAddressList(AccountAddress accountAddress);
	
	/**
     * 新增账户地址
     * 
     * @param accountAddress 账户地址信息
     * @return 结果
     */
	public int insertAccountAddress(AccountAddress accountAddress);
	
	/**
     * 修改账户地址
     * 
     * @param accountAddress 账户地址信息
     * @return 结果
     */
	public int updateAccountAddress(AccountAddress accountAddress);
	
	/**
     * 删除账户地址
     * 
     * @param id 账户地址ID
     * @return 结果
     */
	public int deleteAccountAddressById(Long id);
	
	/**
     * 批量删除账户地址
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	public int deleteAccountAddressByIds(String[] ids);
	/**
	 * 修改
	 * @param accountAddress
	 * @return
	 */
	int updateAccountQScoreAddress(AccountAddress accountAddress);
	
	/**
	 * 根据地址查询
	 * @param walletAddress
	 * @return
	 */
	public AccountAddress selectAccountAddressByAddress(String walletAddress);
	/**
	 * 更新转出账号余额
	 * @param walletBalance
	 * @param id
	 * @param sign
	 * @return
	 */
	int updateTurnOutWalletBalance(@Param("walletBalance")Long walletBalance,@Param("id")Long id,@Param("sign")String sign);
	/**
	 * 更新转入账号余额
	 * @param walletBalance
	 * @param id
	 * @return
	 */
	int updateTurnInWalletBalance(@Param("walletBalance")Long walletBalance,@Param("id")Long id,@Param("sign")String sign);
	/**
	 * 插入交易Hash
	 * @param transHash
	 * @return
	 */
	int insertTransHash(@Param("transHash")String transHash);
	
	
	/**
	 * 批量更新地址余额
	 * @param list
	 * @return
	 */
    int  updateBatchUserWalletBalance(List<UserBanlanceVO> list);
    /**
     * 查询HASH是否存在
     * @param transHash
     * @return
     */
    String selectTransHash(@Param("transHash")String transHash);
}